package bma.common.langutil.jmshell.cmdopt;

import java.util.Locale;

/**
 * An option that expects a long integer value
 */
public class LongOption extends Option<Long> {

	public LongOption(char shortForm, String longForm, String tips) {
		super(Long.class, shortForm, longForm, true, tips);
	}

	public LongOption(String shortForm, String longForm, String tips) {
		super(Long.class, shortForm, longForm, true, tips);
	}

	@Override
	protected Long parseValue(String arg, Locale locale)
			throws IllegalOptionValueException {
		try {
			return new Long(arg);
		} catch (NumberFormatException e) {
			throw new IllegalOptionValueException(this, arg);
		}
	}
}